package com.web.dao;

import com.web.entity.VIPUserInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface VIPUserInfoMapper {
    @Delete({
        "delete from APP_VIP_USER",
        "where vip_id = #{vipId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer vipId);

    @Insert({
        "insert into APP_VIP_USER (vip_id, user_id, ",
        "vip_basis_id, vip_create_time, ",
        "vip_modify_time)",
        "values (#{vipId,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, ",
        "#{vipBasisId,jdbcType=INTEGER}, #{vipCreateTime,jdbcType=TIMESTAMP}, ",
        "#{vipModifyTime,jdbcType=TIMESTAMP})"
    })
    int insert(VIPUserInfo record);

    int insertSelective(VIPUserInfo record);

    @Select({
        "select",
        "vip_id, user_id, vip_basis_id, vip_create_time, vip_modify_time",
        "from APP_VIP_USER",
        "where vip_id = #{vipId,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    VIPUserInfo selectByPrimaryKey(Integer vipId);

    int updateByPrimaryKeySelective(VIPUserInfo record);

    @Update({
        "update APP_VIP_USER",
        "set user_id = #{userId,jdbcType=VARCHAR},",
          "vip_basis_id = #{vipBasisId,jdbcType=INTEGER},",
          "vip_create_time = #{vipCreateTime,jdbcType=TIMESTAMP},",
          "vip_modify_time = #{vipModifyTime,jdbcType=TIMESTAMP}",
        "where vip_id = #{vipId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(VIPUserInfo record);
}